﻿using System;
using System.Runtime.Serialization;
using LiSA_Server.Base.NHibernate.Models;
using NHibernate;
using NHibernate.Mapping.ByCode.Conformist;

namespace LiSA_Service.ResearchProjects.Models
{
    [DataContract]
    public class Author : Entity
    {

        [DataMember]
        public virtual string FullName { get; set; }

        [DataMember]
        public virtual string FirstName { get; set; }

        [DataMember]
        public virtual string MiddleName { get; set; }

        [DataMember]
        public virtual string LastName { get; set; }

        [DataMember]
        public virtual string Title { get; set; }

        [DataMember]
        public virtual Guid OrganizationID { get; set; }
    } 
    
    /// <summary>
    /// The ArticleFeedback mapping.
    /// </summary>
    public class AuthorMapping : ClassMapping<Author>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthorMapping"/> class.
        /// </summary>
        public AuthorMapping()
        {
            this.Property(x => x.FullName, x => x.Type(NHibernateUtil.StringClob));
            this.Property(x => x.FirstName);
            this.Property(x => x.MiddleName);
            this.Property(x => x.LastName);
            this.Property(x => x.OrganizationID);
            this.Property(x => x.Title, x => x.Type(NHibernateUtil.StringClob));
        }
    }
}